package com.lagou.edu.util;

import java.util.Random;

/**
 * @author: jie.zhao
 * @create: 2021/07/29 12:12
 */
public class CodeUtil {

    public static final String produceCode(int length){
        String str="0123456789";
        Random random=new Random();
        StringBuffer sb=new StringBuffer();
        for(int i=0;i<length;i++){
            int number=random.nextInt(10);
            sb.append(str.charAt(number));
        }
        return sb.toString();
    }


}
